package com.freecloud.graphql.resoliver;

import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import com.freecloud.graphql.vo.StudentVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: maomao
 * @Date: 2022/1/12 4:08 PM
 */
@Slf4j
@Component
public class StudentResolver implements GraphQLQueryResolver {

    public List<StudentVo> findStudent() {
        log.info("进去：findStudent");
        List<StudentVo> list = new ArrayList<>();

        list.add(new StudentVo("code1", "name1"));
        list.add(new StudentVo("code2", "name2"));
        list.add(new StudentVo("code3", "name3"));
        return list;
    }
}
